import { defineConfig } from 'vite'
import { resolve } from 'path'
import vue2 from '@vitejs/plugin-vue2'
import vue2Jsx from '@vitejs/plugin-vue2-jsx'

export default defineConfig({

  build: {
    lib: {
      entry: resolve(__dirname, 'src/index.js'),
      name: 'a-map',
      fileName: 'a-map'
    },
    rollupOptions: {
      external: ['vue'],
      output: {
        globals: {
          vue: 'Vue'
        }
      }
    }
  },
  plugins: [
    vue2(),
    vue2Jsx()
  ]
})